import request from '../utils/request'

// 某一频道tab栏数据
export interface OtherChannelExtra {
  crmUserGroupId: string
  crmUserGroupName: string
  itemFrom: number
  materialContentFrom: number
  materialId: string
  materialName: string
  materialType: string
  rcmdSort: boolean
  resourcesId: number
  taskId: string
  taskType: number
}

export interface OtherChannel {
  extra: OtherChannelExtra
  id: number
  picUrl: string
  targetUrl: string
}

export type OtherChannelList = OtherChannel[]

// 某一频道的列表的详细数据相关的接口
export interface HomeListCategoryModel {
  id: number,
  superCategoryId: number,
  showIndex: number,
  name: string,
  frontName: string,
  frontNameIcon: null,
  frontDesc: string,
  level: string,
  wapBannerUrl: string,
  type: number,
  categoryType: number,
}
export interface ItemModel {
  id: number,
  listPicUrl: string,
  name: string,
  seoTitle: string,
  simpleDesc: string,
  primaryPicUrl: string,
  primarySkuId: number,
  retailPrice: number,
  counterPrice: number,
  sortOriginPrice: number,
}
export interface CategoryItemModel {
  category: HomeListCategoryModel,
  itemList: ItemModel[]
}
export type CategoryItemListModel = CategoryItemModel[]

export default {
  // 获取某一频道数据
  getOtherChannel(categoryId: number) {
    return request.get(`/wy/item/list.json?__timestamp=1630136511866&categoryId=${categoryId}`)
  }
}